# load required libs
require(plotrix)
# Read files
Norm100 <- read.table("norm230mlock.csv", header=TRUE)
Norm100P <- read.table("norm230pmlock.csv", header=TRUE)
# Define data and boundaries
maxCycles <- 200000
yAxisMarks <- c(0, round(0.5*maxCycles), round(maxCycles))
colors <- c("lightblue","blue")
# Save our graph
#png("histogram100.png")
postscript("histogram230mlock.ps")
# Histogram (100 Tasks)
data1<-hist(rbind(Norm100$Task),plot=FALSE,breaks=0:229)$counts
data2<-hist(rbind(Norm100P$Task),plot=FALSE,breaks=0:229)$counts
barp(rbind(data1, data2), col=colors)
abline(h=yAxisMarks, col="gray", lwd=0.5)
# Print the legend
legend("topright",inset=.05, title="Cycles per Task", c("With Priority", "Without Priority"), fill=colors)
# Switch the device off to get a safe instance end
dev.off()

